#ifndef __APP_API_H__
#define __APP_API_H__

#include "stdint.h"
#include "stdbool.h"
#include "net_qrf.h"
#include "app_key_value.h"
#include "app_led.h"
/**********************get hard information***************************/

typedef struct{
  uint8_t psn[16];
  uint8_t deviceType;
  uint8_t modelType;
  uint8_t hardType;
  uint8_t pmacID[8];
  uint8_t pRfVer[3];
  uint8_t sensorVer[3];
}hardinfo_t;

void SM_main(void);
void SM_process(void);

void test_gpio_level_get(void);
void test_model_timeout_restart(uint8_t sec);
bool device_test_sleep_state_get(void);
bool device_sleep_state_get(void);
app_key_value_err_e SM_key_value_handler(void);
void SM_led_start(uint8_t *data, blinkType_t type);
void recv_option_key_value_handler(uint8_t *option);
void recv_operation_key_value_handler(uint8_t *operation);
void erase_device_data(void);

void SM_detect_ctl_on(void);
void SM_detect_ctl_off(void);
uint8_t SM_battery_get(void);

int8_t SM_tempDrv_get(void);

uint8_t get_hard_information(uint8_t *data);

/******************get model api***********************/
//最大长度不超过64字节
uint8_t get_device_state(uint8_t *buffer);

void SM_device_QRF_state_Handle(QRFH1_t qrfH1, QRFH2_t qrfH2);
/***************static power test api*****************/

void staticPowerGpioInit(void);

bool isBattVoltageHigh(void);
void rssiCheckFailedIndicate();

typedef enum {
  startUpTrigger,
  buttonTrigger,
}commissionType_t;

typedef enum {
  keyFob_device,
  EB_device,
  other_device,
}deviceType_t;
void startCommissiongJoin(commissionType_t type, deviceType_t device);

#endif

